//
//  GCChaZhaoTagTableViewCell.m
//  GoldChampion
//
//  Created by Mac on 2018/4/12.
//  Copyright © 2018年 stoneobs@icloud.com. All rights reserved.
//

#import "GCChaZhaoTagTableViewCell.h"

@interface  GCChaZhaoTagTableViewCell()
@property(nonatomic, strong) STLabel                     *nameLable;
@property(nonatomic, strong) STButton                     *numButton;

@property(nonatomic, strong) UIImageView                     *imageView1;
@property(nonatomic, strong) UIImageView                     *imageView2;
@property(nonatomic, strong) UIImageView                     *imageView3;
@property(nonatomic, strong) UIImageView                     *imageView4;

@property(nonatomic, strong) NSArray                     *imageArray;

@end
@implementation GCChaZhaoTagTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self == [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self configSubView];
    }
    return self;
}
+ (CGFloat)cellHeight{
    return 44 + (UIScreenWidth - 30 - 6)/4 + 20;
}
#pragma mark --subView
- (void)configSubView{

    
    self.nameLable = [[STLabel alloc] initWithFrame:CGRectMake(15, 0, 200, 44)
                                               text:@"#指尖上的大运河#"
                                                textColor:SecendTextColor
                                                     font:16
                                              isSizetoFit:NO
                                            textAlignment:NSTextAlignmentLeft];
    [self addSubview:self.nameLable];
    
    
    self.numButton = [[STButton alloc] initWithFrame:CGRectMake(15, 0, 200, 44)
                                                title:@"    218     "
                                           titleColor:SecendTextColor
                                            titleFont:14
                                         cornerRadius:0
                                      backgroundColor:nil
                                      backgroundImage:nil
                                                image:[UIImage imageNamed:@"FANYE"]];
    self.numButton.right = UIScreenWidth - 15;
    [self.numButton makeImageRight];
    self.numButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentRight;
    [self addSubview:self.numButton];
    
    
    CGFloat imageViewWith = (UIScreenWidth - 30 - 6)/4;
    
    NSArray * imageArray = @[@"RENWU",@"wenquan",@"YUNHE2",@"YUNHE1",@"RENWU"];
    
    self.imageView1 = [[UIImageView alloc] initWithFrame:CGRectMake(15, 44, imageViewWith, imageViewWith)];
    self.imageView1.image = [UIImage imageNamed:@"RENWU"];
    [self addSubview:self.imageView1];
    

    self.imageView2 = [[UIImageView alloc] initWithFrame:CGRectMake(self.imageView1.right + 2, 44, imageViewWith, imageViewWith)];
    self.imageView2.image = [UIImage imageNamed:@"wenquan"];
    [self addSubview:self.imageView2];
    
    
    self.imageView3 = [[UIImageView alloc] initWithFrame:CGRectMake(self.imageView2.right + 2, 44 , imageViewWith, imageViewWith)];
    self.imageView3.image = [UIImage imageNamed:@"YUNHE2"];
    [self addSubview:self.imageView3];
    
    
    self.imageView4 = [[UIImageView alloc] initWithFrame:CGRectMake(self.imageView3.right + 2, 44, imageViewWith, imageViewWith)];
    self.imageView4.image = [UIImage imageNamed:@"YUNHE1"];
    [self addSubview:self.imageView4];
    
    self.imageArray = @[self.imageView1,self.imageView2,self.imageView3,self.imageView4];
}
- (void)debugRandromImage{
    NSInteger imageCount = arc4random()%4;
    for (NSInteger i = 0; i< self.imageArray.count; i ++) {
        UIImageView * imageView = self.imageArray[i];
        if (i <= imageCount) {
            imageView.hidden = NO;
        }else{
            imageView.hidden = YES;
        }
    }
}
@end
